---
title: 'Get database'
description: 'Retrieve a Postgres connection by its ID or name.'
api: 'GET /postgres_databases/{id_or_name}'
---

import DatabaseResponseExample from '/snippets/postgres-database-response-snippet.mdx'

### Path parameters

<ParamField path="id_or_name" type="string" required>
  The ID or name of the Postgres database connection.
</ParamField>

### Query parameters

<ParamField path="show_sensitive" type="boolean" default="false">
  Set to `true` to include the database password in the response. Defaults to `false`, which obfuscates the password.
</ParamField>

### Example request

```bash curl Using Name
curl -X GET 'https://api.sequinstream.com/api/postgres_databases/production_rds?show_sensitive=true' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json'
```

```bash curl Using ID
curl -X GET 'https://api.sequinstream.com/api/postgres_databases/2593a3fc-9afe-4ea8-8ede-cffc8ae57c89' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json'
```

## Response

Returns a single Postgres database object.

<ResponseField name="data" type="object">
  A Postgres database object.
  <Expandable title="properties" defaultOpen={true}>
    <DatabaseResponseExample />
  </Expandable>
</ResponseField>

<ResponseExample>
```json 200 OK
{
  "data": {
    "database": "sequin_prod",
    "hostname": "db.abc123xyz.us-east-1.rds.amazonaws.com",
    "id": "2593a3fc-9afe-4ea8-8ede-cffc8ae57c89",
    "ipv6": false,
    "name": "production_rds",
    "password": "supersecret", // Not obfuscated because show_sensitive=true
    "pool_size": 10,
    "port": 5432,
    "queue_interval": 1000,
    "queue_target": 50,
    "replication_slots": [
        {
            "publication_name": "sequin_pub",
            "slot_name": "sequin_slot",
            "status": "active"
        }
    ],
    "ssl": true,
    "use_local_tunnel": false,
    "username": "sequin_user"
  }
}
```
```json 404 Not Found
{
    "errors": {
        "detail": "Postgres Database not found"
    }
}
```
</ResponseExample>
